package com.by.service;

import com.alibaba.csp.sentinel.SphO;
import com.alibaba.fastjson.JSONObject;
import com.by.service.OrderService;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * @author ServivE
 * @version 0.1
 * @className OrderServiceImpl2
 * @description
 * @date 2024/10/31 20:55
 * @since jdk17
 */
//@Service
public class OrderServiceImpl2 implements OrderService {
    @Override
    public Map get() {
        Map map = new HashMap();
        if (SphO.entry("查询订单")) {
            //
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            map.put("id", "1");
            map.put("orderNum", "msdd20241031001");
            SphO.exit();
        } else {
            map.put("code", 0);
            map.put("msg", "查询订单失败");
        }
        return map;
    }
}
